package com.hllxd.hism.star.basic.service.service.ai;

import com.hllxd.hism.star.basic.service.dao.mapper.doris.DPExecuteLogMapper;
import com.hllxd.hism.star.basic.service.model.doris.DPExecuteLog;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @Author wuguangxi
 * @Description
 * @Date 2024/5/10 15:32
 */
@Service
public class DPExecuteLogService {
    @Autowired
    private DPExecuteLogMapper dpExecuteLogMapper;

    public List<DPExecuteLog> findByTableNameAndDt(String tableName, String dt){
        if(Strings.isEmpty(tableName) || Strings.isEmpty(dt)){
            return Collections.emptyList();
        }
        return dpExecuteLogMapper.findByTableName(tableName, dt);
    }

    public DPExecuteLog findOneByUniqueId(String uniqueId){
        if(Strings.isEmpty(uniqueId)){
            return null;
        }
        return dpExecuteLogMapper.findOneByUniqueId(uniqueId);
    }
}
